#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
DecToBin(char str[], int n)
{
	int i = 0, j;
	while (n != 0)
	{
		str[i++] = n%2+'0';
		n = n/2;
	}
	for (j = i; j < 16; j++)
		str[j] = '0';
}

int Hymin(char* x, char* y)
{
	int count = 0, i;
	for (i = 0; i < 16; i++)
		if (*(x++)!=*(y++)) count++;
	return count;
}
main()
{
	int m, n;
	char a[17], b[17];
	scanf("%d%d", &m, &n);
	DecToBin(a,m);
	DecToBin(b,n);
	printf("distance of %d and %d = %d\n", m, n, Hymin(a,b));
}